package com.cap.dreamcircle.Utils;

import java.util.Random;

/**
 * 自动生成随机颜色的工具类
 * Created by liukanshan on 2016/12/10.
 */

public class RandomColorUtils {

    public static String RandomColor() {
        Random random = new Random();
        String RR = Integer.toHexString(random.nextInt(256));
        String GG = Integer.toHexString(random.nextInt(256));
        String BB = Integer.toHexString(random.nextInt(256));
        RR = (RR.length() < 2) ? ("0" + RR) : RR;
        GG = (GG.length() < 2) ? ("0" + GG) : GG;
        BB = (BB.length() < 2) ? ("0" + BB) : BB;
        return "#" + RR + GG + BB;
    }

}
